<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div class="app">
        <h2>爱好</h2>
        <h3 v-for="h in student.hobby">
            {{h}}
        </h3>
        <button @click="btn">点我删除</button>
    </div>
</body>
<script>
    const vm = new Vue({
        data:{
            student:{
                hobby:['抽烟','喝酒','打麻将']
            }
        },
        methods: {
            btn(){
                this.student.hobby.pop()
            }
        },
    }).$mount('.app')

</script>
</html>